package com.yanqu.road.entity.manor;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.config.fishpond.FishPondItemConfig;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author ：zfr
 * @date ：2021/10/11 15:18
 */
public class FishData extends DataObject {
    //玩家id
    private long userId;
    //鱼id
    private int fishId;
    //数量
    private long num;
    //历史最高重量
    private long highestWeight;
    //装备的门客id
    private int equipPatronsId;
    //晋升等级
    private int lv;
    //图鉴是否看过
    private boolean isReadSample;
    //是否领取解锁奖励
    private boolean isGetUnLockReward;
    //是否展示
    private boolean isShow;
    //装备次数
    private int equipTimes;
    //购买的装备次数
    private int equipBuyTimes;
    //技能列表
    private Map<Integer, FishSkillData> fishSkillDataMap = new ConcurrentHashMap<>();
    //更新时间
    private long lastUpdateTime;
    //累计钓起数量
    private long accFishingCount;
    //真实钓起数量
    private long realFishingCount;

    public FishData(long userId) {
        this.userId = userId;
    }

    public FishData() {
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getFishId() {
        return fishId;
    }

    public void setFishId(int fishId) {
        this.fishId = fishId;
    }

    public long getNum() {
        return num;
    }

    public void setNum(long num) {
        if (this.num != num) {
            this.num = num;
            setUpdateOption();
        }
    }

    public long getHighestWeight() {
        return highestWeight;
    }

    public void setHighestWeight(long highestWeight) {
        if (this.highestWeight != highestWeight) {
            this.highestWeight = highestWeight;
            setUpdateOption();
        }
    }

    public int getEquipPatronsId() {
        return equipPatronsId;
    }

    public void setEquipPatronsId(int equipPatronsId) {
        if (this.equipPatronsId != equipPatronsId) {
            this.equipPatronsId = equipPatronsId;
            setUpdateOption();
        }
    }

    public int getLv() {
        return lv;
    }

    public void setLv(int lv) {
        if (this.lv != lv) {
            this.lv = lv;
            setUpdateOption();
        }
    }

    public boolean isReadSample() {
        return isReadSample;
    }

    public void setReadSample(boolean readSample) {
        if (isReadSample != readSample) {
            isReadSample = readSample;
            setUpdateOption();
        }
    }

    public boolean isGetUnLockReward() {
        return isGetUnLockReward;
    }

    public void setGetUnLockReward(boolean getUnLockReward) {
        if (isGetUnLockReward != getUnLockReward) {
            isGetUnLockReward = getUnLockReward;
            setUpdateOption();
        }
    }

    public boolean isShow() {
        return isShow;
    }

    public void setShow(boolean show) {
        if (isShow != show) {
            isShow = show;
            setUpdateOption();
        }
    }

    public int getEquipTimes() {
        return equipTimes;
    }

    public void setEquipTimes(int equipTimes) {
        if (this.equipTimes != equipTimes) {
            this.equipTimes = equipTimes;
            setUpdateOption();
        }
    }

    public int getEquipBuyTimes() {
        return equipBuyTimes;
    }

    public void setEquipBuyTimes(int equipBuyTimes) {
        if (this.equipBuyTimes != equipBuyTimes) {
            this.equipBuyTimes = equipBuyTimes;
            setUpdateOption();
        }
    }

    public Map<Integer, FishSkillData> getFishSkillDataMap() {
        return fishSkillDataMap;
    }

    public void setFishSkillDataMap(Map<Integer, FishSkillData> fishSkillDataMap) {
        this.fishSkillDataMap = fishSkillDataMap;
        setUpdateOption();
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }

    public void setLastUpdateTime(long lastUpdateTime) {
        if (this.lastUpdateTime != lastUpdateTime) {
            this.lastUpdateTime = lastUpdateTime;
            setUpdateOption();
        }
    }

    public long getAccFishingCount() {
        return accFishingCount;
    }

    public void setAccFishingCount(long accFishingCount) {
        if (this.accFishingCount != accFishingCount) {
            this.accFishingCount = accFishingCount;
            setUpdateOption();
        }
    }

    public long getRealFishingCount() {
        return realFishingCount;
    }

    public void setRealFishingCount(long realFishingCount) {
        if (this.realFishingCount != realFishingCount) {
            this.realFishingCount = realFishingCount;
            setUpdateOption();
        }
    }

    public void init(FishPondItemConfig config, long weight, int initNum, int realFishing) {
        fishId = config.getId();
        num = initNum;
        accFishingCount = 1;
        lv = 0;
        highestWeight = weight;
        realFishingCount = realFishing;
        setInsertOption();
    }
}
